// home模块下所有数据
import {reqPersonalized,reqAlbumNewset} from '@/api'

const state={
    PersonalizedList:{},
    newAlbum:[],
}

const mutations={
    GETPERSONALIZED(state,data){
        state.PersonalizedList = data;
    },
    GETNEW(state,data){
        state.newAlbum = data;
    },
}

const actions={
    //获取热门推荐
    async getPersonalized({commit},limit,area){
        let obj = await reqPersonalized(limit,area);
        if(obj.code == 0){
            commit('GETPERSONALIZED',obj.result);
        }
    },
    //获取新碟上架
    async getNew({commit}){
        let obj = await reqAlbumNewset();
        if(obj.code == 0){
            commit('GETNEW',obj.result);
        }
    },
    //获取全部新碟
    async getAlbumAll({commit},{limit,offset,area}){
        let result = null;
    },

}
const getters={}

export default{
    state,
    mutations,
    actions,
    getters
}